package tom.jiafei;

class ComputerBean{
	double numberA = 0;
	double numberB = 0;
	double result = 0;
	String operator = "+";

	
	public void setNumberA(double a){
		numberA = a;
	}
	public void setNumberB(double b){
		numberB = b;
	}
	public void setResult(double r){
		result = r;
	}
	public void setOperator(String str){
		operator = str;
	}
	
	
	public double getNumberA(){
		return numberA;
	}
	public double getNumberB(){
		return numberB;
	}
	public String getOperator(){
		return operator;
	}
	public ComputerBean() {
		// TODO Auto-generated constructor stub
	}
	
	public double getResult(){
		if(operator.equals("+")){
			result = numberA + numberB;
		} else if (operator.equals("-")) {
			result = numberA - numberB;
		} else if (operator.equals("*")) {
			result = numberA * numberB;
		}else if (operator.equals("/")) {
			result = numberA / numberB;
		}
		
		return result;
	}
	
}